stim_id=round(aux_data(3,frame_times)*2);

stim_id(48000:end)=0;


ids=[-1:-1:-6 1:6 7];

l_win=50;
r_win=200;

snips={};

act=ftfil(ROIs(sel_roi).activity,18,0,10);
act=aaa;
act=psmooth(act);
raw_act=act/median(act);

for ind=1:13
    curr_onsets=find(diff(stim_id==ids(ind))==1);
    curr_snips=[];
    
    curr_onsets=curr_onsets(curr_onsets>l_win);
    for knd=1:length(curr_onsets)
        snips{ind}(:,knd)=raw_act(curr_onsets(knd)-l_win:curr_onsets(knd)+r_win);
    end
end
    
for ind=1:13
    figure;plot(snips{ind});title(num2str(ind))
end

corr_ind=[1:3 1:3 4:6 4:6;ones(3,1)' ones(3,1)'*2 ones(3,1)' ones(3,1)'*2];

for ind=1:12
    resp_map(corr_ind(1,ind),corr_ind(2,ind))=mean(mean(snips{ind}(50:150,:)))-1;
end

figure;
colormap gray
axes('position',[0.1 0.1 0.375 0.8])
imagesc(-resp_map(1:3,:)')
clim=get(gca,'clim');
axis off
axes('position',[0.525 0.1 0.375 0.8])
imagesc(-resp_map(4:6,:)')
set(gca,'clim',clim);
axis off
